//
//  NSString+BYDateAndString.m
//  School+
//
//  Created by Sean Sebastian on 16/5/5.
//  Copyright © 2016年 Sean Sebastian. All rights reserved.
//

#import "NSString+BYDateAndString.h"

@implementation NSString (BYDateAndString)

+ (NSDate *)dateFromString:(NSString *)dateString
{
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat: @"yyyy-MM-dd HH:mm:ss"];
    return [formatter dateFromString:dateString];
}
+ (NSString *)stringFromDate:(NSDate *)date
{
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat: @"yyyy-MM-dd HH:mm:ss"];
    return [formatter stringFromDate:date];
}

@end
